import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * user:likai
 * Date:2022-12-15
 * Time:17:34
 */
class Main {
    public static String reserveString(String string) {
        char []ch = string.toCharArray();
        int length = string.length();
        reserve(ch, 0, length - 1);
        for(int i=0;i<length;i++){
            int j=i;
            while(i<length&&ch[i]!=' '){
                i++;
            }
            reserve(ch,j,i-1);
        }
        // int i = 0;
        // while ( i < length ) {
        //     int j = i;
        //     while (j < length && ch[j] != ' ') {
        //         j++;
        //     }
        //     if (j < length) {
        //         reserve(ch, i, j - 1);
        //         i = j + 1;
        //     } else {
        //         reserve(ch, i, j - 1);
        //         i = j;
        //     }
        // }
        return new String(ch);
    }
    private static void reserve(char[] ch, int i, int length) {
        while (i < length) {
            char tmp = ch[i];
            ch[i] = ch[length];
            ch[length] = tmp;
            i++;
            length--;
        }
    }
    //找出最长数字长度的字符串并打印

    public int MoreThanHalfNum_Solution(int [] array) {
        int i = 0;
        int tmp = array[i];
        int times = 1;
        for (i=1; i < array.length; i++) {
            if (times == 0) {
                tmp = array[i];
                times++;
            } else {
                if (array[i] == tmp) {
                    times++;
                } else {
                    times--;
                }

            }
        }
        return tmp;
    }
}
public class Test {
    public static void main1(String[] args) {
        Scanner scanner=new Scanner(System.in);
        String string=scanner.nextLine();
        Main main=new Main();
        String ret=main.reserveString(string);
        System.out.println(ret);
    }
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        String string=scanner.nextLine();
        String pre="";
        String cur="";
        int i = 0;
        for (; i < string.length(); i++) {
            char ch=string.charAt(i);
            if(ch>='0'&&ch<='9'){
                cur=cur+ch;
            }else{
                if(cur.length()>pre.length()){
                    pre=cur;
                }
                cur="";
            }
        }
        if(i== string.length() && pre.length()< cur.length()) {
            pre = cur;
        }
        System.out.println(pre);
    }
}
